Skip to content

Fix example with iterable #13027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2020
Merged

Fix example with iterable #13027

merged 1 commit into from
Feb 5, 2020

Conversation

peterjaap
Copy link
Contributor

The old example throws this error; PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Console\Helper\ProgressBar::iterate() must be iterable, object given

Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix!

@@ -105,11 +105,17 @@ which starts, advances and finishes the progress bar automatically::

$progressBar = new ProgressBar($output);

// $iterable can be for example an array ([1, 2, 3, ...]) or a generator
// $iterable = function () { yield 1; yield 2; ... };
// $iterable can be for example an array ([1, 2, 3, ...])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it could be reworded now to something like // $iterable can be an array

@HeahDude HeahDude added this to the 4.4 milestone Feb 4, 2020
@OskarStark OskarStark changed the base branch from 5.0 to 4.4 February 5, 2020 07:08
@OskarStark
Copy link
Contributor

OskarStark commented Feb 5, 2020

Good job, thanks Peter and congrats on your first contribution to the Symfony documentation. I made the changes requested by @HeahDude in fe6c38f

OskarStark added a commit that referenced this pull request Feb 5, 2020
This PR was submitted for the 5.0 branch but it was squashed and merged into the 4.4 branch instead (closes #13027).

Discussion
----------

Fix example with iterable

The old example throws this error; `PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Symfony\Component\Console\Helper\ProgressBar::iterate() must be iterable, object given`

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/roadmap for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `master` for features of unreleased versions).

-->

Commits
-------

36b6e43 Fix example with iterable
OskarStark added a commit that referenced this pull request Feb 5, 2020
@OskarStark OskarStark merged commit 36b6e43 into symfony:4.4 Feb 5, 2020
OskarStark added a commit that referenced this pull request Feb 5, 2020
* 4.4:
  minor. refs #13027
  Fix example with iterable
OskarStark added a commit that referenced this pull request Feb 5, 2020
* 5.0:
  minor. refs #13027
  Fix example with iterable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants